<#include "license.ftl">
<@license/>
package ${doc.all.package}.gwt.constants;

/**
 * @author Redora (www.redora.net)
*/
public interface Messages extends com.google.gwt.i18n.client.Messages {
<#macro copy_arg br>
<#assign maxNumber = 0>
<#assign num = 0>
<#list br.params.param as param>
    <#assign num = num + 1>
    <#if param?contains(',')>
        <#assign index = param?index_of(',')>
        <#assign param = param?substring(0,index)> 
    </#if> 
    <#if param?number gte maxNumber>
    <#assign maxNumber = param?number>
    <#if num gt 1>,</#if>String arg${param?number}
    </#if>
</#list>
</#macro>

<#list doc["/all/object"] as model>
    <#if model.businessRules[0]??>
        <#list model.businessRules.businessRule as br>
            <#if br.@javadoc[0]??>/** ${br.@javadoc} */</#if>
            <#assign defaultMessage = "">
            <#list br.message as message>
                <#if message.@language == "en">
                    <#assign defaultMessage = message?chop_linebreak?trim?j_string>
                </#if>
            </#list>
    @DefaultMessage("${defaultMessage}")
    @Key("${model.@name}.businessRule_${br.@number}")
    String ${model.@name?uncap_first}_businessRule_${br.@number}(<#if br.params[0]??><@copy_arg br=br/></#if>);
        </#list>
    </#if>

    <#if model.messages[0]??>
        <#list model.messages.messageBundle as bundle>
            <#if bundle.@javadoc[0]??>/** ${bundle.@javadoc} */</#if>
            <#assign defaultMessage = "">
            <#list bundle.message as message>
                <#if message.@language == "en">
                    <#assign defaultMessage = message?chop_linebreak?trim?j_string>
                </#if>
            </#list>
    @DefaultMessage("${defaultMessage}")
    @Key("${model.@name}.message_[${bundle.@number}")
    String ${model.@name?uncap_first}_message_${bundle.@number}(<#if bundle.params[0]??><@copy_arg br=bundle/></#if>);
        </#list>
    </#if>
</#list>
}